package com.sm.service.impl;

import com.sm.dao.AccountDao;
import com.sm.dao.UserDao;
import com.sm.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountDao accountDao;

    @Transactional
    public void transfer() {
        accountDao.addMoney("李四",1000);
        int x = 1/0;
        accountDao.lessMoney("张三",1000);
    }
}
